import re

# http请求头
headers = {
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"}

# 下载目录
download_dir = 'F:/Download/'

# 日期提取正则模式
date_pattern = re.compile("1[4-9]-[1]?[0-9]")

database_name, table_name = "log.db", "LOG"     # 缓存数据库的数据库
failed = "failed.log.txt"                       # 失败日志输出文件

# 缓存表SQL
table_create = f"""
                CREATE TABLE {table_name} (
                    re_link VARCHAR(256) PRIMARY KEY NOT NULL,
                    status SMALLINT NOT NULL,
                    down_dir VARCHAR(5) NOT NULL)
                """

from_tmp = True    # 是否从缓存下载，初次下载请False，断点续传请True
num = 50        # 实际下载数量
timeout = 5     # 超时设置

domain = 'https://www.51voa.com/'  # 网站域名
init_link = "VOA_Standard_1.html"  # 初始页面相对路径

cata_selector = "#Right_Content > div.pagelist > a:nth-child(1n+1)"  # 目录页链接选择器
date_selector = "#Right_Content > div.List > ul > li:nth-child(1n+1)"  # 发布日期选择器，发布日期将作为文件夹命名
detail_link_selector = "#Right_Content > div.List > ul > li:nth-child(1n+1) > a"  # 详情页链接选择器
text_selector = '#Right_Content > div.Content > p:nth-child(1n+1)'  # 文本选择器
voice_link_selector = "#mp3"  # 音频文件链接选择器
